<?php

namespace Admin\Model;

use Think\Model;

class UserModel extends Model {

    protected $trueTableName = 'tb_users';

    public function getFind($where) {
        $result = $this->where($where)->find();
        return $result;
    }

    public function getList($where, $param) {
        $count = $this->where($where)->count();
        $Page = new \Think\Page($count, 10, $param);
        $list = $this->where($where)->limit($Page->firstRow . ',' . $Page->listRows)->order('createdt DESC')->select();
        $show = $Page->show(); // 分页显示输出
        return array('list' => $list, 'count' => $count, 'page' => $show);
    }
    
    public function getListForExcel($where, $param) {
        $count = $this->where($where)->count();
        $Page = new \Think\Page($count, 10, $param);
        $list = $this->where($where)->order('createdt DESC')->select();
        $show = $Page->show(); // 分页显示输出
        return array('list' => $list, 'count' => 1, 'page' => 1);
    }

}
